from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

driver = webdriver.Firefox()
# 1.最大化浏览器窗口
driver.maximize_window()
url = 'file:///C:/Users/TEACHER/Desktop/NSD2405/html/registerA.html'
driver.get(url)

# 2.设置为指定大小
# sleep(3)
# driver.set_window_size(1000, 700)
# 3.设置窗口位置
# sleep(3)
# driver.set_window_position(800, 300)
# 点击含有"新浪"文本的链接
sleep(3)
driver.find_element(By.PARTIAL_LINK_TEXT, '新浪').click()
# 4.后退
sleep(3)
driver.back()
# 5.前进
sleep(3)
driver.forward()

sleep(3)
driver.quit()
